package com.htc.model.request;

public class ClassesRequest extends PageRequest{
	
	private String title;
	private String code;
	private Integer id;
	private Integer notPid;
	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	public Integer getNotPid() {
		return notPid;
	}
	public void setNotPid(Integer notPid) {
		this.notPid = notPid;
	}
	public String convertWhereStr() {
		StringBuffer where = new StringBuffer(" where 1=1 ");
		if(title!=null&&title.trim().length()!=0) {
			where.append(" and cname like '%"+title+"%'");
		}
		if(code!=null&&code.trim().length()!=0) {
			where.append(" and code like '%"+code+"%'");
		}
		if(id!=null) {
			where.append(" and cid='"+id+"'");
		}
		if(notPid!=null) {
			where.append(" and pid!='"+notPid+"'");
		}
		return where.toString();
	}
	
	
	
}
